<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加用户</title>
      <title>欢迎登陆轻松办公系统</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <script type="text/javascript" src="js/libs/jquery/1.6/jquery.min.js"></script>
        <script type="text/javascript" src="js/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
        <link rel="stylesheet" href="css/min.css" />
        <script type="text/javascript" src="js/min.js"></script>
        <script type="text/javascript" src="content/settings/main.js"></script>
	    <link rel="stylesheet" href="content/settings/style.css" />
    </head>
    <body>
  <div class="settings" id="settings">
        <div class="wrapper">
            <div class="grid3">
                <div class="titre">背景色</div>
                <a href="url(css/img/bg.html" class="backgroundChanger active" title="White"></a>
                <a href="url(css/img/dark-bg.html" class="backgroundChanger dark" title="Dark"></a>
            	<div class="clear"></div>
            </div>
        </div>
        <a class="settingbutton" href="#"> </a>
    </div>        
        <!--              
                HEAD
         --> 
         <!--==================================登录头部分显示的部分（信息）============================================-->
        <div id="head">
            <div class="left">
                <a href="#" class="button profile"><img src="img/icons/top/huser.png" alt="" /></a>
                	你好：
                <a href="#">${sessionScope.user1.user_loginName }</a>
                &nbsp;||&nbsp;
                <a href="userAction_logout" onclick="return confirm('确定注销系统吗？')">注销</a>
            </div>
            <div class="right">
                <form action="#" id="search" class="search placeholder">
                    <label>你要找的东西 ?</label>
                    <input type="text" value="" name="q" class="text"/>
                    <input type="submit" value="rechercher" class="submit"/>
                </form>
            </div>
        </div>
        <!--            
                SIDEBAR
         --> 
         <!--=============================== 左侧要显示的数据（菜单）====================================  -->
         <div id="sidebar">
        	<ul>
        		<li>
        			<a href="${pageContext.request.contextPath }/index.jsp"><img src="${pageContext.request.contextPath }/img/icons/menu/home.png" alt="" />返回首页</a>
        		</li>
      			<s:iterator value="#application.topPowerList">
	      			<s:if test="#session.user1.hasPowerByName(power_name)">
		       			<li>
		       			<a href="#"><img src="img/icons/menu/${power_name }.png" alt="" />${power_name }</a>
		                    <ul>
		                    	<s:iterator value="power_children">
			                    	<s:if test="#session.user1.hasPowerByName(power_name)">
			                        		<li>
			                        			<a href="${pageContext.request.contextPath }${power_url }">${power_name }</a>
			                        		</li>
			                        </s:if>
		              			</s:iterator>
		                    </ul>
		                 </li>
		            </s:if>
	            </s:iterator>
        	</ul>
        </div>       
        <!--            
              CONTENT 
        --> 
        <!-- ===================================中间显示的部分（主体）========================================= -->
		
		<div id="content" class="white">
			   <div class="bloc">
			   <div class="title"></div>
			    <div class="content dashboard">
			        <div class="center" style="text-align: center;">
			            <a href="linkAction_list" class="shortcut">
			                <img src="img/contact.png" alt="" width="48" height="48"/>
			                通讯录
			            </a>
			            <a href="usermarkAction_list?unique_id=${sessionScope.user1.unique_id }" class="shortcut last">
			                <img src="img/page.png" alt="" width="48" height="48" />
			                我的便签
			            </a>
			            <a href="forum_queryAllForum.action?type=0" class="shortcut">
			                <img src="img/baohu.ico" alt="" width="48" height="48" />
			                论坛板块
			            </a>
			            <a href="applicationAction_list" class="shortcut">
			                <img src="img/rutun.ico" alt="" width="48" height="48" />
			                起草申请
			            </a>
			            <a href="applicationAction_myApplicationList" class="shortcut last">
			                <img src="img/liuchen.ico" alt="" width="48" height="48" />
			                申请列表
			            </a>
			            <a href="applicationAction_myTaskList" class="shortcut last">
			                <img src="img/icon.png" alt="" width="48" height="48" />
			                待我审批
			            </a>
			            <a href="#" class="shortcut last">
			                <img src="img/dep.ico" alt="" width="48" height="48" />
			                我的邮件
			            </a>
			            <a href="#" class="shortcut last">
			                <img src="img/user.ico" alt="" width="48" height="48" />
			                我的任务
			            </a>
			            <div class="cb"></div>
			        </div>
			        <p></p>
			    </div>
			</div>  
			<div class="bloc">
		    <div class="title">
		        	用户管理
		    </div>
		    <div class="content dashboard">
		        <div class="center">
		            <form action="userAction_${requestScope.user1.unique_id==null?'add':'update'}" method="post">
		            	<input type="hidden" name="unique_id" value="${requestScope.user1.unique_id }">
		            <div class="input">
		            <label for="input1">所属部门：</label>
		            	<s:select name="departmentId"
		               		list="#departmentList" listKey="unique_id" listValue="department_name"
		               		headerKey="" headerValue="====请选择部门===="
		               	/>
		        	</div>
		            <div class="input">
		            	<label for="input1">所属岗位：</label>
		             		<c:forEach items="${requestScope.postList }" var="postList">
		             			<c:forEach items="${requestScope.user1.postSet }" var="postSet">
		             				<c:if test="${postSet.post_name==postList.post_name }">
				            			<c:set value="checked" var="check"></c:set>
			             			</c:if>
		             			</c:forEach>
		             			<input type="checkbox" name="postIds" value="${postList.unique_id }" ${check} >
								${postList.post_name }
								<c:remove var="check"/>
		             		</c:forEach>
		        	</div>
		        	<div class="input">
		            	<label for="input1">登录名：</label>
		            	<input type="text" id="input1" name="user_loginName" value="${requestScope.user1.user_loginName }"/>
		        	</div>
		        	<div class="input">
		            	 <label for="input1">姓名：</label>
		            	 <input type="text" id="input1" name="user_name" value="${requestScope.user1.user_name }"/>
		        	</div>
		        	<div class="input">
		            <label for="input1">性别：</label>
		            		<c:choose>
		            			<c:when test="${requestScope.user1.user_gender=='男' }">
		            				<input type="radio" id="radio1" name="user_gender" value="男" checked="checked"/>
		            				<big>男&nbsp;</big>
		            				<input type="radio" id="radio1" name="user_gender" value="女"/>
		            				<big>女&nbsp;</big>
		            			</c:when>
		            			<c:when test="${requestScope.user1.user_gender=='女' }">
		            				<input type="radio" id="radio1" name="user_gender" value="男"/>
		            				<big>男&nbsp;</big>
		            				<input type="radio" id="radio1" name="user_gender" value="女" checked="checked"/>
		            				<big>女&nbsp;</big>
		            			</c:when>
		            			<c:otherwise>
		            				<input type="radio" id="radio1" name="user_gender" value="男"/>
		            				<big>男&nbsp;</big>
		            				<input type="radio" id="radio1" name="user_gender" value="女"/>
		            				<big>女&nbsp;</big>
		            			</c:otherwise>
		            		</c:choose>
		        	</div>
		        	<div class="input">
		            <label for="input1">联系电话：</label>
		                 <input type="text" id="input1" name="user_phoneNumber" value="${requestScope.user1.user_phoneNumber }"/>
		        	</div>
		        	<div class="input">
		            <label for="input1">E-mail：</label>
		            	 <input type="text" id="input1" name="user_email" value="${requestScope.user1.user_email }"/>
		        	</div>
					 <div class="input textarea">
			            <label for="textarea1">备注：</label>
			            <textarea name="user_description" id="textarea1" rows="7" cols="4">${requestScope.user1.user_description }</textarea>
		        	 </div> 
		       		 <div class="submit" style="text-align: center;">
		           		<input type="submit" value="提交" />
		           		<input type="button" onclick="javascript:history.go(-1)" value="取消" class="black"/>
		      	 	</div>
					</form>
		        </div>
		     </div>
		  </div>
	  </div>
</body>
</html>